package com.codeling.annotation.controller;

import com.codeling.annotation.annotate.LoginRequired;
import com.codeling.annotation.annotate.MyLog;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Mr.ling
 * @data: 2022/3/4
 * @apiNote
 */
@RestController
public class IndexController {
    @GetMapping("/sourceA")
    public String sourceA() {
        return "你正在访问A资源";
    }

    @GetMapping("/sourceB")
    @LoginRequired
    public String sourceB() {
        return "你正在访问B资源";
    }

    @MyLog
    @GetMapping("/sourceC/{source_name}")
    public String sourceC(@PathVariable("source_name")String sourceName) {
        return "你正在访问C资源";
    }

}
